/*
 * @Author: your name
 * @Date: 2021-11-15 15:26:07
 * @LastEditTime: 2021-11-15 19:05:41
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \vue-response-analysis\src\index.js
 */
// console.log('数据响应式原理：')
import observe from './obseve.js'
import Watcher from './Watcher.js'

let obj = {
    a: {
        m: {
            n: 5
        }
    },
    b: [111, 2, 3]
}

observe(obj)


obj.a.m.n = 6
obj.b.push(4)
obj.b.splice(2, 1, [11, 55])

new Watcher(obj, 'a.m.n', (val) => {
    // console.log('------', val)
})

setTimeout(() => {
    obj.a.m.n = '更新值监听'
    
},2000)




// console.log(obj.b)